

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>配置管理系统 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="config-key layout" href="../config-key/" />
    <link rel="prev" title="Cephx 认证协议详细阐述" href="../cephx_protocol/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../internals/">Ceph 内幕</a> &raquo;</li>
        
      <li>配置管理系统</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/dev/config.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../">
          

          
            
            <img src="../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../developer_guide/">开发者指南</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../internals/">Ceph 内幕</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../blkin/">Tracing Ceph With LTTng</a></li>
<li class="toctree-l2"><a class="reference internal" href="../blkin/#tracing-ceph-with-blkin">Tracing Ceph With Blkin</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bluestore/">BlueStore Internals</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cache-pool/">Cache pool</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ceph_krb_auth/">如何配置好 Ceph Kerberos 认证的详细文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cephfs-mirroring/">CephFS Mirroring</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cephfs-reclaim/">CephFS Reclaim Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cephfs-snapshots/">CephFS 快照</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cephx/">Cephx</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cephx_protocol/">Cephx 认证协议详细阐述</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">配置管理系统</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id2">配置文件</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id3">元变量</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id4">读取配置值</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id5">更改配置值</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id6">定义配置选项</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#level">level</a></li>
<li class="toctree-l4"><a class="reference internal" href="#desc-long-desc-and-fmt-desc"><code class="docutils literal notranslate"><span class="pre">desc</span></code>, <code class="docutils literal notranslate"><span class="pre">long_desc</span></code> and <code class="docutils literal notranslate"><span class="pre">fmt_desc</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#id7">默认值</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id8">服务</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id9">标签</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id10">枚举值</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id11">标记</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../config-key/">config-key layout</a></li>
<li class="toctree-l2"><a class="reference internal" href="../context/">CephContext</a></li>
<li class="toctree-l2"><a class="reference internal" href="../continuous-integration/">Continuous Integration Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../corpus/">资料库结构</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cpu-profiler/">Oprofile 的安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cxx/">C++17 and libstdc++ ABI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../deduplication/">去重</a></li>
<li class="toctree-l2"><a class="reference internal" href="../delayed-delete/">CephFS delayed deletion</a></li>
<li class="toctree-l2"><a class="reference internal" href="../dev_cluster_deployement/">开发集群的部署</a></li>
<li class="toctree-l2"><a class="reference internal" href="../dev_cluster_deployement/#id5">在同一机器上部署多套开发集群</a></li>
<li class="toctree-l2"><a class="reference internal" href="../development-workflow/">开发流程</a></li>
<li class="toctree-l2"><a class="reference internal" href="../documenting/">为 Ceph 写作文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../encoding/">序列化（编码、解码）</a></li>
<li class="toctree-l2"><a class="reference internal" href="../erasure-coded-pool/">纠删码存储池</a></li>
<li class="toctree-l2"><a class="reference internal" href="../file-striping/">File striping</a></li>
<li class="toctree-l2"><a class="reference internal" href="../freebsd/">FreeBSD Implementation details</a></li>
<li class="toctree-l2"><a class="reference internal" href="../generatedocs/">Ceph 文档的构建</a></li>
<li class="toctree-l2"><a class="reference internal" href="../health-reports/">Health Reports</a></li>
<li class="toctree-l2"><a class="reference internal" href="../iana/">IANA 号</a></li>
<li class="toctree-l2"><a class="reference internal" href="../kubernetes/">Hacking on Ceph in Kubernetes with Rook</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libs/">库体系结构</a></li>
<li class="toctree-l2"><a class="reference internal" href="../logging/">集群日志的用法</a></li>
<li class="toctree-l2"><a class="reference internal" href="../logs/">调试日志</a></li>
<li class="toctree-l2"><a class="reference internal" href="../macos/">在 MacOS 上构建</a></li>
<li class="toctree-l2"><a class="reference internal" href="../messenger/">Messenger notes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mon-bootstrap/">Monitor bootstrap</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mon-elections/">Monitor Elections</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mon-on-disk-formats/">ON-DISK FORMAT</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mon-osdmap-prune/">FULL OSDMAP VERSION PRUNING</a></li>
<li class="toctree-l2"><a class="reference internal" href="../msgr2/">msgr2 协议（ msgr2.0 和 msgr2.1 ）</a></li>
<li class="toctree-l2"><a class="reference internal" href="../network-encoding/">Network Encoding</a></li>
<li class="toctree-l2"><a class="reference internal" href="../network-protocol/">网络协议</a></li>
<li class="toctree-l2"><a class="reference internal" href="../object-store/">对象存储架构概述</a></li>
<li class="toctree-l2"><a class="reference internal" href="../osd-class-path/">OSD class path issues</a></li>
<li class="toctree-l2"><a class="reference internal" href="../peering/">互联</a></li>
<li class="toctree-l2"><a class="reference internal" href="../perf/">Using perf</a></li>
<li class="toctree-l2"><a class="reference internal" href="../perf_counters/">性能计数器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../perf_histograms/">Perf histograms</a></li>
<li class="toctree-l2"><a class="reference internal" href="../placement-group/">PG （归置组）说明</a></li>
<li class="toctree-l2"><a class="reference internal" href="../quick_guide/">开发者指南（快速）</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rados-client-protocol/">RADOS 客户端协议</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rbd-diff/">RBD 增量备份</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rbd-export/">RBD Export &amp; Import</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rbd-layering/">RBD Layering</a></li>
<li class="toctree-l2"><a class="reference internal" href="../release-checklists/">Release checklists</a></li>
<li class="toctree-l2"><a class="reference internal" href="../release-process/">Ceph Release Process</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seastore/">SeaStore</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sepia/">Sepia 社区测试实验室</a></li>
<li class="toctree-l2"><a class="reference internal" href="../session_authentication/">Session Authentication for the Cephx Protocol</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing/">测试笔记</a></li>
<li class="toctree-l2"><a class="reference internal" href="../versions/">Public OSD Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="../vstart-ganesha/">NFS CephFS-RGW Developer Guide</a></li>
<li class="toctree-l2"><a class="reference internal" href="../wireshark/">Wireshark Dissector</a></li>
<li class="toctree-l2"><a class="reference internal" href="../zoned-storage/">Zoned Storage Support</a></li>
<li class="toctree-l2"><a class="reference internal" href="../osd_internals/">OSD 开发者文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mds_internals/">MDS 开发者文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../radosgw/">RADOS 网关开发者文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ceph-volume/">ceph-volume 开发者文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../crimson/">Crimson developer documentation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="id1">
<h1>配置管理系统<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h1>
<p>配置管理系统存在的理由是为了向每一个守护进程提供正确的配置信息。配置信息是一系列键值对。</p>
<dl>
<dt>如何设置配置值？有好几种方法：</dt><dd><ul>
<li><p>ceph 配置文件，名字一般是 ceph.conf</p></li>
<li><p>命令行参数:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">--</span><span class="n">debug</span><span class="o">-</span><span class="n">ms</span><span class="o">=</span><span class="mi">1</span>
<span class="o">--</span><span class="n">debug</span><span class="o">-</span><span class="n">monc</span><span class="o">=</span><span class="mi">10</span>
</pre></div>
</div>
<p>等等。</p>
</li>
<li><p>在运行时用 <code class="docutils literal notranslate"><span class="pre">injectargs</span></code> 或 <code class="docutils literal notranslate"><span class="pre">config</span> <span class="pre">set</span></code> 注入的参数</p></li>
</ul>
</dd>
</dl>
<div class="section" id="id2">
<h2>配置文件<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<p>Most configuration settings originate in the Ceph configuration file.</p>
<p>How do we find the configuration file? Well, in order, we check:</p>
<blockquote>
<div><ul class="simple">
<li><p>the default locations</p></li>
<li><p>the environment variable <code class="docutils literal notranslate"><span class="pre">CEPH_CONF</span></code></p></li>
<li><p>the command line argument <code class="docutils literal notranslate"><span class="pre">-c</span></code></p></li>
</ul>
</div></blockquote>
<p>Each stanza of the configuration file describes the key-value pairs that will be in
effect for a particular subset of the daemons. The “global” stanza applies to
everything. The “mon”, “osd”, and “mds” stanzas specify settings to take effect
for all monitors, all OSDs, and all mds servers, respectively.  A stanza of the
form <code class="docutils literal notranslate"><span class="pre">mon.$name</span></code>, <code class="docutils literal notranslate"><span class="pre">osd.$name</span></code>, or <code class="docutils literal notranslate"><span class="pre">mds.$name</span></code> gives settings for the monitor, OSD, or
MDS of that name, respectively. Configuration values that appear later in the
file win over earlier ones.</p>
<p>A sample configuration file can be found in src/sample.ceph.conf.</p>
</div>
<div class="section" id="id3">
<h2>元变量<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2>
<p>The configuration system allows any configuration value to be
substituted into another value using the <code class="docutils literal notranslate"><span class="pre">$varname</span></code> syntax, similar
to how bash shell expansion works.</p>
<p>A few additional special metavariables are also defined:</p>
<blockquote>
<div><ul class="simple">
<li><p>$host: expands to the current hostname</p></li>
<li><p>$type: expands to one of “mds”, “osd”, “mon”, or “client”</p></li>
<li><p>$id: expands to the daemon identifier. For <code class="docutils literal notranslate"><span class="pre">osd.0</span></code>, this would be <code class="docutils literal notranslate"><span class="pre">0</span></code>; for <code class="docutils literal notranslate"><span class="pre">mds.a</span></code>, it would be <code class="docutils literal notranslate"><span class="pre">a</span></code>; for <code class="docutils literal notranslate"><span class="pre">client.admin</span></code>, it would be <code class="docutils literal notranslate"><span class="pre">admin</span></code>.</p></li>
<li><p>$num: same as $id</p></li>
<li><p>$name: expands to $type.$id</p></li>
</ul>
</div></blockquote>
</div>
<div class="section" id="id4">
<h2>读取配置值<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<p>There are two ways for Ceph code to get configuration values. One way is to
read it directly from a variable named <code class="docutils literal notranslate"><span class="pre">g_conf</span></code>, or equivalently,
<code class="docutils literal notranslate"><span class="pre">g_ceph_ctx-&gt;_conf</span></code>. The other is to register an observer that will be called
every time the relevant configuration values change. This observer will be
called soon after the initial configuration is read, and every time after that
when one of the relevant values changes. Each observer tracks a set of keys
and is invoked only when one of the relevant keys changes.</p>
<p>The interface to implement is found in <code class="docutils literal notranslate"><span class="pre">common/config_obs.h</span></code>.</p>
<p>The observer method should be preferred in new code because</p>
<blockquote>
<div><ul class="simple">
<li><p>It is more flexible, allowing the code to do whatever reinitialization needs
to be done to implement the new configuration value.</p></li>
<li><p>It is the only way to create a std::string configuration variable that can
be changed by injectargs.</p></li>
<li><p>Even for int-valued configuration options, changing the values in one thread
while another thread is reading them can lead to subtle and
impossible-to-diagnose bugs.</p></li>
</ul>
</div></blockquote>
<p>For these reasons, reading directly from <code class="docutils literal notranslate"><span class="pre">g_conf</span></code> should be considered deprecated
and not done in new code.  Do not ever alter <code class="docutils literal notranslate"><span class="pre">g_conf</span></code>.</p>
</div>
<div class="section" id="id5">
<h2>更改配置值<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<p>Configuration values can be changed by calling <code class="docutils literal notranslate"><span class="pre">g_conf()-&gt;set_val</span></code>. After changing
the configuration, you should call <code class="docutils literal notranslate"><span class="pre">g_conf()-&gt;apply_changes</span></code> to re-run all the
affected configuration observers. For convenience, you can call
<code class="docutils literal notranslate"><span class="pre">g_conf()-&gt;set_val_or_die</span></code> to make a configuration change which you think should
never fail.</p>
<p><code class="docutils literal notranslate"><span class="pre">injectargs</span></code>, <code class="docutils literal notranslate"><span class="pre">parse_argv</span></code>, and <code class="docutils literal notranslate"><span class="pre">parse_env</span></code> are three other functions which modify
the configuration. Just like with set_val, you should call apply_changes after
calling these functions to make sure your changes get applied.</p>
</div>
<div class="section" id="id6">
<h2>定义配置选项<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2>
<p>Config options are defined in <code class="docutils literal notranslate"><span class="pre">common/options/*.yaml.in</span></code>. The options are categorized
by their consumers. If an option is only used by ceph-osd, it should go to
<code class="docutils literal notranslate"><span class="pre">osd.yaml.in</span></code>. All the <code class="docutils literal notranslate"><span class="pre">.yaml.in</span></code> files are translated into <code class="docutils literal notranslate"><span class="pre">.cc</span></code> and <code class="docutils literal notranslate"><span class="pre">.h</span></code> files
at build time by <code class="docutils literal notranslate"><span class="pre">y2c.py</span></code>.</p>
<p>Each option is represented using a YAML mapping (dictionary). A typical option looks like</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">public_addr</span>
  <span class="nt">type</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">addr</span>
  <span class="nt">level</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">basic</span>
  <span class="nt">desc</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">public-facing address to bind to</span>
  <span class="nt">long_desc</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">The IP address for the public (front-side) network.</span>
    <span class="l l-Scalar l-Scalar-Plain">Set for each daemon.</span>
  <span class="nt">services</span><span class="p">:</span>
  <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mon</span>
  <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mds</span>
  <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">osd</span>
  <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mgr</span>
  <span class="nt">flags</span><span class="p">:</span>
  <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">startup</span>
  <span class="nt">with_legacy</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>
</pre></div>
</div>
<p>In which, following keys are allowed:</p>
<div class="section" id="level">
<h3>level<a class="headerlink" href="#level" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal notranslate"><span class="pre">level</span></code> property of an option is an indicator for the probability the
option is adjusted by an operator or a developer:</p>
<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">basic</span></code></dt>
<dd><p>for basic config options that a normal operator is likely to adjust.</p>
</dd></dl>

<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">advanced</span></code></dt>
<dd><p>for options that an operator <em>can</em> adjust, but should not touch unless they
understand what they are doing. Adjusting advanced options poorly can lead to
problems (performance or even data loss) if done incorrectly.</p>
</dd></dl>

<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">dev</span></code></dt>
<dd><p>for options in place for use by developers only, either for testing purposes,
or to describe constants that no user should adjust but we prefer not to compile
into the code.</p>
</dd></dl>

</div>
<div class="section" id="desc-long-desc-and-fmt-desc">
<h3><code class="docutils literal notranslate"><span class="pre">desc</span></code>, <code class="docutils literal notranslate"><span class="pre">long_desc</span></code> and <code class="docutils literal notranslate"><span class="pre">fmt_desc</span></code><a class="headerlink" href="#desc-long-desc-and-fmt-desc" title="Permalink to this headline">¶</a></h3>
<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">desc</span></code></dt>
<dd><p>Short description of the option. Sentence fragment. e.g.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">desc</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">Default checksum algorithm to use</span>
</pre></div>
</div>
</dd></dl>

<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">long_desc</span></code></dt>
<dd><p>The long description is complete sentences, perhaps even multiple
paragraphs, and may include other detailed information or notes. e.g.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">long_desc</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">crc32c, xxhash32, and xxhash64 are available.  The _16 and _8 variants use</span>
  <span class="l l-Scalar l-Scalar-Plain">only a subset of the bits for more compact (but less reliable) checksumming.</span>
</pre></div>
</div>
</dd></dl>

<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">fmt_desc</span></code></dt>
<dd><p>The description formatted using reStructuredText. This property is
only used by the <code class="docutils literal notranslate"><span class="pre">confval</span></code> directive to render an option in the
document. e.g.:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">fmt_desc</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">The interval for &quot;deep&quot; scrubbing (fully reading all data). The</span>
  <span class="l l-Scalar l-Scalar-Plain">``osd_scrub_load_threshold`` does not affect this setting.</span>
</pre></div>
</div>
</dd></dl>

</div>
<div class="section" id="id7">
<h3>默认值<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3>
<p>There is a default value for every config option. In some cases, there may
also be a <em>daemon default</em> that only applies to code that declares itself
as a daemon (in this case, the regular default only applies to non-daemons). Like:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">default</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">crc32c</span>
</pre></div>
</div>
<p>Some literal postfixes are allowed when options with type of <code class="docutils literal notranslate"><span class="pre">float</span></code>, <code class="docutils literal notranslate"><span class="pre">size</span></code>
and <code class="docutils literal notranslate"><span class="pre">secs</span></code>, like:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mon_scrub_interval</span>
  <span class="nt">type</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">secs</span>
  <span class="nt">default</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">1_day</span>
<span class="p p-Indicator">-</span> <span class="nt">name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">osd_journal_size</span>
  <span class="nt">type</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">size</span>
  <span class="nt">default</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">5_K</span>
</pre></div>
</div>
<p>For better readability, it is encouraged to use these literal postfixes when
adding or updating the default value for an option.</p>
</div>
<div class="section" id="id8">
<h3>服务<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3>
<p>Service is a component name, like “common”, “osd”, “rgw”, “mds”, etc. It may
be a list of components, like:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">services</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mon</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mds</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">osd</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mgr</span>
</pre></div>
</div>
<p>For example, the rocksdb options affect both the osd and mon. If an option is put
into a service specific <code class="docutils literal notranslate"><span class="pre">.yaml.in</span></code> file, the corresponding service is added to
its <code class="docutils literal notranslate"><span class="pre">services</span></code> property automatically. For instance, <code class="docutils literal notranslate"><span class="pre">osd_scrub_begin_hour</span></code>
option is located in <code class="docutils literal notranslate"><span class="pre">osd.yaml.in</span></code>, even its <code class="docutils literal notranslate"><span class="pre">services</span></code> is not specified
explicitly in this file, this property still contains <code class="docutils literal notranslate"><span class="pre">osd</span></code>.</p>
</div>
<div class="section" id="id9">
<h3>标签<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3>
<p>Tags identify options across services that relate in some way. For example:</p>
<dl class="simple">
<dt>network</dt><dd><p>options affecting network configuration</p>
</dd>
<dt>mkfs</dt><dd><p>options that only matter at mkfs time</p>
</dd>
</dl>
<p>Like:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">tags</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">network</span>
</pre></div>
</div>
</div>
<div class="section" id="id10">
<h3>枚举值<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3>
<p>For options with a defined set of allowed values:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">enum_values</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">none</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">crc32c</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">crc32c_16</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">crc32c_8</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">xxhash32</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">xxhash64</span>
</pre></div>
</div>
</div>
<div class="section" id="id11">
<h3>标记<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3>
<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">runtime</span></code></dt>
<dd><p>the value can be updated at runtime</p>
</dd></dl>

<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">no_mon_update</span></code></dt>
<dd><p>Daemons/clients do not pull this value from the monitor config database.  We
disallow setting this option via <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">config</span> <span class="pre">set</span> <span class="pre">...</span></code>.  This option should
be configured via <code class="docutils literal notranslate"><span class="pre">ceph.conf</span></code> or via the command line.</p>
</dd></dl>

<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">startup</span></code></dt>
<dd><p>option takes effect only during daemon startup</p>
</dd></dl>

<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">cluster_create</span></code></dt>
<dd><p>option only affects cluster creation</p>
</dd></dl>

<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">create</span></code></dt>
<dd><p>option only affects daemon creation</p>
</dd></dl>

</div>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../config-key/" class="btn btn-neutral float-right" title="config-key layout" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../cephx_protocol/" class="btn btn-neutral float-left" title="Cephx 认证协议详细阐述" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>